package emulator.hardware.nmos6502;

import emulator.EmulatorException;
import emulator.assembler.SymbolTable;
import emulator.hardware.HwByte;
import emulator.hardware.HwWord;
import emulator.hardware.debug.BusWatchException;
import emulator.hardware.memory.UnmappedMemoryException;
import emulator.hardware.nmos6502.operands.OperandException;
import emulator.support.OperandEval;
import emulator.util.MemoryPtr;

/** Abstract Operand */
public interface Operand {
	/** fetch value 
	 * @throws UnmappedMemoryException 
	 * @throws BusWatchException */
	void init(Cpu6502 cpu) throws EmulatorException;
	/** observe word value 
	 * @throws OperandException */
	HwWord getWord() throws OperandException;
	/** observe byte value 
	 * @throws EmulatorException */
	HwByte getByte() throws EmulatorException;
	/** observe word value
	 * @throws OperandException */
	void setWord(HwWord data) throws OperandException;
	/** observe byte value
	 * @throws EmulatorException */
	void setByte(HwByte data) throws EmulatorException;
	/** get disassembler string for operand */
	String getString() throws EmulatorException;
	/** get byte count (0,1,2) */
	int getByteCount();
	/** get dissambled code for operand using a symbol table */
	String getString(MemoryPtr mem_ref, SymbolTable symbols);
	/** get cycles used for fetching the operand */
	int getExtraCycles();
	/** evaluates operand content */
	OperandEval getEvaluator(MemoryPtr mem_ref);
}
